package alogrithm;

/**
 * @author lbw
 * @version 1.0
 * @date 2021/10/19 10:43
 */
public class RotateMatrix {
    public int[][] rotateMatrix(int[][] mat, int n) {
        // write code here
        int[][] res = new int[n][n];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                res[j][n - i - 1] = mat[i][j];
            }
        }
        return res;
    }
}
